<?php
require_once ('User.php');

/**
 * @author Eliandor
 * @version 1.0
 * @created 01-aug-2011 15:59:29
 */
class Authentication
{
	static function getCurrentUser()
	{
		global $auth_options;
			
		require_once( dirname(__FILE__) . '/../controller/userController.php');
		$userController = new userController();
		
		$a = new Auth("MDB2", $auth_options, array($userController, "login"), false);
		$a->start();
		
		if ($a->getAuth())
		{
			return new Member($a->getUsername());
		}
		else
		{
			return new Guest();
		}
	}
	
	public static function logout()
	{
		$a = new Auth("MDB2", $options, array($userController, "login"), false);
		$a->start();
		$a->logout();
	}
}
?>